﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Data;
using System.Configuration;

public partial class admin_edconsultingdetailslang : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void addbt_Click(object sender, EventArgs e)
    {
        connection con = new connection();
        SqlConnection cn = con.connect();
        SqlCommand mySqlSelect = new SqlCommand("update consultingdetails_lang set title = @tit, content = @cont where id = @id and lang = @lang", cn);
        mySqlSelect.CommandType = CommandType.Text;

        SqlParameter tit = new SqlParameter("@tit", SqlDbType.NVarChar, 100);
        tit.Value = title.Text;

        SqlParameter cont = new SqlParameter("@cont", SqlDbType.NVarChar);
        cont.Value = content.Value;

        SqlParameter id = new SqlParameter("@id", SqlDbType.BigInt);
        id.Value = Request.Params["id"];

        SqlParameter lg = new SqlParameter("@lang", SqlDbType.NVarChar, 2);
        lg.Value = Request.Params["lang"];

        mySqlSelect.Parameters.Add(tit);
        mySqlSelect.Parameters.Add(cont);
        mySqlSelect.Parameters.Add(id);
        mySqlSelect.Parameters.Add(lg);
        mySqlSelect.ExecuteNonQuery();
        cn.Close();
        info.Text = "Cập nhật dữ liệu thành công";
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        Response.Redirect("Default.aspx?page=qlconsultingdetaillang&id=" + Request.Params["id"]);
    }
}